package com.conversationboard.view;

import java.util.List;

import com.conversationboard.config.Configuration;
import com.conversationboard.model.StyleSheet;

public class StyleSheetListDisplay {

    public static String display(List<StyleSheet> styleSheets) {

        StringBuilder buffer = new StringBuilder();

        buffer.append("<form class=\"formsection\" action='" + Configuration.getInstance().getRoot() + "/ChangeStyleSheetControllerServlet' method='post'>");

        buffer.append("<p>Please select one of the following styles:</p>");

        for (StyleSheet sheet : styleSheets) {
            buffer.append("<input type='radio' name='optionid' value='" + sheet.getFileName() + "'>" + sheet.getFileName() + ": " + sheet.getDescription() + "</input><br />\n");
        }
        
        buffer.append("<br />");
        buffer.append("<input type='submit' value='Change Style' /> ");
        buffer.append("<br />");
        buffer.append("<br /></form>");
        

        return buffer.toString();

    }

}
